import React from 'react';
import Form from 'taro-vform';
import { View, Input } from '@tarojs/components';
export default (props) => {
  const { require, label, onlyKey, placeholder, form } = props;
  console.log(props);
  return (

    <Form.Item
      name={onlyKey ? onlyKey : label}
      label={label}
      rules={[{ required: require, message: `${label}不能为空` }]}
    >
      <Input className='form_input_box' onInput={(e) => { form.setFieldValue(onlyKey ? onlyKey : label, e.target.value) }} placeholder={placeholder} />
    </Form.Item>


  );
};
